package org.example.huawei;

import java.util.concurrent.locks.LockSupport;

/**
 * @author: lynn
 * @Descript:
 * @date: 2022/2/9 21:29
 * @version: 1.0
 */
public class SwaggerOne {

    private static char[] cu="ABC".toCharArray();
    private static char[] nu="123".toCharArray();
    private static Thread t1=null;
    private static Thread t2=null;

    public static void main(String[] args) {

          t1=new Thread(()->{
           for (char c:nu){
               System.out.print(c);
               LockSupport.unpark(t2);
               LockSupport.park();
           }
        });

          t2=new Thread(()->{
            for (char c:cu){
                LockSupport.park();
                System.out.print(c);
                LockSupport.unpark(t1);
            }
        });

         t1.start();
         t2.start();
    }
}
